<template>
  <div class="back-bar-box">
    <a-button
      style="padding-left: 0"
      type="link"
      danger
      @click="goBack"
    >
      <template #icon>
        <LeftOutlined />
      </template>
      返回
    </a-button>
    <div class="line"></div>
    <div class="name">{{ title }}</div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { LeftOutlined } from "@ant-design/icons-vue";

interface Props {
  title: string;
}

const props = defineProps<Props>();
const router = useRouter();

const goBack = () => {
  router.back();
};
</script>

<style scoped lang="less">
.back-bar-box {
  width: 100%;
  height: auto;
  float: left;
  display: flex;
  align-items: center;

  .line {
    width: 1px;
    height: 14px;
    background-color: #d8d8d8;
    margin-right: 15px;
  }

  .name {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
  }
}
</style>
